<template>
    <div id="app">
        <app-header v-if="header_show"></app-header>
        <app-header-b v-if="header_b_show"></app-header-b>
        <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
        <router-view></router-view>
        </van-pull-refresh>
        <app-footer v-if="footer_show"></app-footer>
    </div>
</template>

<script>
	import Header from './components/header'
	import HeaderB from './components/headerBlank'
	import Footer from './components/footer'

	export default {
		name: 'App',
		data () {
			return {
				header_show: false,
				header_b_show: true,
				footer_show: false,
				bar_active: 'home',
				isLoading: false
			}
		},
		components: {
			'app-header': Header,
			'app-header-b': HeaderB,
			'app-footer': Footer,
		},
		methods: {
			// 下拉刷新
			onRefresh() {
				setTimeout(() => {
					this.$toast('刷新成功');
					this.isLoading = false;
					this.count++;
				}, 500);
			},
			//是否显示头部
			header: function (bool) {
				this.header_show = bool
			},
			//是否显示头部
			headerB: function (bool) {
				this.header_b_show = bool
			},
			//是否显示底部
			footer: function (bool) {
				this.footer_show = bool
			},
			//底部选中
			active: function (posi) {
				this.bar_active = posi
			}
		}
	}
</script>

<style lang="less">
    @import './assets/v1/common.less';
</style>
